package com.example.wyt.recycleviewtest

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import android.widget.TextView

@Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
class DescActivity : AppCompatActivity() {
    var vwIma:ImageView? = null
    var vwName:TextView? = null
    var vwDesc:TextView? = null
    var imaId:Int? = null
    var names:String? = null
    var desc:String? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_desc)
        initDate()
        initView()
    }

    private fun initDate() {
        val intent = intent
        val bundle = intent.extras
        names = bundle.getString("name")
        imaId = bundle.getInt("imaId")
        desc = bundle.getString("desc")
    }

    private fun initView() {
        vwIma = this.findViewById(R.id.vw_ima)
        vwName = this.findViewById(R.id.vw_name)
        vwDesc = this.findViewById(R.id.vw_desc)
        vwIma!!.setImageResource(this.imaId!!)
        vwDesc!!.text = desc
        vwName!!.text = names
    }
}
